<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
		var arr = [2,4,6];
		var num = 0;
		for(var i=0; i<arr.length; i++){
			num += arr[i];
		}
		console.log(num);
	</script>
</body>
</html>